local ProjectName = "ReadData"
set_project(ProjectName)
set_toolchains("gcc")
set_languages("c++11")

target("main")
    set_kind("shared")

    -- set Baltamatica path
    if is_os("linux") then
        BALTAMPATH = "/opt/Baltamatica"
    elseif is_os("windows") then
        BALTAMPATH = "D:\\baltamatica"
    end

    -- add include search directories
    add_includedirs(path.join(BALTAMPATH, "include"))
    add_includedirs("include")
    add_includedirs("src/utils")
    add_includedirs("src/core")
    -- add link libraries and search directories
    add_linkdirs(path.join(BALTAMPATH, "lib"))
    -- link
    add_links("bex")
    -- source files
    add_files("src/main.cpp",
              "src/utils/*.cpp",
              "src/core/*.cpp")

    -- set basename main, libmain.so
    set_basename("main")
    -- set no lib prefix, main.so
    set_prefixname("")

    -- Set install directory
    set_installdir(path.join(BALTAMPATH, "plugins"))
    -- Rename the default bin directory to ProjectName
    set_prefixdir("/", {bindir = ProjectName, libdir = ProjectName})
    -- Add config.json to bin directory
    add_installfiles("config.json", {prefixdir = ProjectName})

target("test_split")
    add_rules("mode.debug")
    set_kind("binary")
    add_includedirs("include")
    add_files("tests/test_split.cpp")
    add_files("src/core/str.cpp")

target("test_trim")
    add_rules("mode.debug")
    set_kind("binary")
    add_includedirs("include")
    add_files("tests/test_trim.cpp")
    add_files("src/core/str.cpp")
